//
//  SeasonTableViewCell.m
//  App-MyFairldy
//
//  Created by dlios on 15-5-25.
//  Copyright (c) 2015年 客官大大. All rights reserved.
//

#import "SeasonTableViewCell.h"

@implementation SeasonTableViewCell

- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatMycell];
    }
    return self;
}

// 创建视图（自定义cell时我们通常在这方法里不指定大小，只能进行初始化操作，并添加进cell）
- (void)creatMycell
{
    self.IconImage = [[UIImageView alloc] init];
    // 添加到cell中（向cell中添加视图的方法为contentView）
    [self.contentView addSubview:self.IconImage];
    
    self.name = [[UILabel alloc] init];
    [self.contentView addSubview:self.name];
    
    self.calorie = [[UILabel alloc] init];
    [self.contentView addSubview:self.calorie];
    
    self.smallImage = [[UIImageView alloc] init];
    [self.contentView addSubview:self.smallImage];
    
    self.calorieLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.calorieLabel];
    
}

// cell中视图的大小，其他属性我们写在layoutsubview中
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.IconImage.backgroundColor = [UIColor clearColor];
    self.IconImage.frame = CGRectMake(10, 10, 100, 80);
    
    self.name.backgroundColor = [UIColor clearColor];
    self.name.frame = CGRectMake(120, 10, 120, 30);
    
    self.calorie.backgroundColor = [UIColor clearColor];
    self.calorie.frame = CGRectMake(120, 60, 120, 30);

    self.smallImage.backgroundColor = [UIColor clearColor];
    self.smallImage.frame = CGRectMake(360, 40, 10, 10);
    
    self.calorieLabel.backgroundColor = [UIColor clearColor];
    self.calorieLabel.frame = CGRectMake(160, 60, 180, 30);
    self.calorieLabel.text = @"大卡/100克";
    
}

- (void)awakeFromNib {

    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
